package com.saasovation.common;

import com.saasovation.common.annotation.TestContainers;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
import org.springframework.transaction.annotation.Transactional;

@SpringBootTest(classes = CommonAppTest.class)
@TestContainers(use = true)
@Transactional
public class CommonAppTestBase extends TestBase {

    @DynamicPropertySource
    public static void dataSourceProperties(DynamicPropertyRegistry registry) {
        if (!useTestContainers(CommonAppTestBase.class)) {
            return;
        }
        initMySqlContainer(registry);
        initRabbitMqContainer(registry);
    }
}
